Miles Sound System SDK 7.2a

Q:

When can I free the memory I gave to MSS?

A:

Since Miles plays out of your memory buffers, you can't free the memory until you know that Miles is done with it.

For example, if you've pointed Miles at some audio data with AIL_set_sample_file, AIL_set_sample_info, or AIL_set_named_sample_file, you can't free the memory until AIL_sample_status returns SMP_DONE. You can call AIL_end_sample to instantly force the status to SMP_DONE.

Occasionally, a crash will occur when a Miles user is freeing sample memory. This may seem to suggest that Miles is still using the data even after the status has changed to SMP_DONE.

Over the last ten years, there have a fair number of folks convinced that this is what was happening (with varying degrees of certainty). In all cases, something else was causing the crash - memory corruption (which using causes a crash in free), another sample was also playing from the same address, etc. Just remember - if SMP_DONE has been set, you can free the memory as long as another sample isn't using it. Guaranteed!

Next Topic (How do I start an audio file somewhere in the middle?)

Previous Topic (How can I play two HSAMPLEs from the same memory address?)


Group: FAQs and How Tos
Related Functions: AIL_end_sample, AIL_mem_free_lock, AIL_sample_status, AIL_set_named_sample_file, AIL_set_sample_file, AIL_set_sample_info
Related Basic Types: MILES_DIGITAL_STATUS
Related FAQs: My application is crashing - what should I try?

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.